<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<div id="rightContent">
	<table class="table table-bordered">
		<tr>
			<th>Order Informations</th>
		</tr>
		<tr>
			<td><form:form class="form-horizontal" action="login.html"
					method="POST" commandname="order">
					<div class="control-group">
						<label class="control-label" for="inputUsername">Order ID</label>
						<div class="controls">
							<input type="text" id="id" name="id" value="${order.id}" disabled>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="inputUsername">Customer</label>
						<div class="controls">
							<input type="text" id="fullname" name="fullname"
								value="${order.fullname}" disabled>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="inputUsername">Phone</label>
						<div class="controls">
							<input type="text" id="phone" name="phone" value="${order.phone}"
								disabled>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="inputUsername">Address</label>
						<div class="controls">
							<input type="text" id="address" name="address"
								value="${order.address}" disabled>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="inputUsername">State</label>
						<div class="controls">
							<input type="text" id="state" name="state"
								<c:if test="${order.state==0}"> value="Pending" </c:if>
								<c:if test="${order.state==1}"> value="Completed" </c:if>
								<c:if test="${order.state==2}"> value="Cancel" </c:if> disabled>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="inputUsername">Payment
							Method</label>
						<div class="controls">
							<input type="text" id="paymentmethod" name="paymentmethod"
								<c:if test="${order.paymentmethod==0}">value="Cash" </c:if>
								<c:if test="${order.paymentmethod==1}" >value="Online Payment (Not Finished)"</c:if>
								<c:if test="${order.paymentmethod==2}" >value="Online Payment (Finished)"</c:if>
								disabled>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="inputUsername">Date</label>
						<div class="controls">
							<input type="text" id="date" name="date"
								value="${order.stringDate}" disabled>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="inputUsername">Note</label>
						<div class="controls">
							<textarea class="field span4" rows="5" id="note" name="note"
								disabled>${order.note}</textarea>
						</div>
					</div>
				</form:form></td>
		</tr>
	</table>
	<h3>List Ordered Product</h3>
	<table class="table table-striped">
		<thead>
			<tr>
				<th>Product Id</th>
				<th>Name</th>
				<th>Quantity</th>
				<th>Unit Price</th>
				<th>Total</th>
			</tr>
		</thead>
		<tbody>
			<c:if test="${!empty orderdetail}">
				<c:forEach items="${orderdetail}" var="detail" varStatus="status">
					<tr>
						<td><c:out value="${detail.product.id}" /></td>
						<td><c:out value="${detail.name}" /></td>
						<td><c:out value="${detail.quantity}" /></td>
						<td><c:out value="${detail.price}" /></td>
						<td><c:out value="${detail.price*detail.quantity}" /></td>
					</tr>
				</c:forEach>
			</c:if>
		</tbody>
	</table>
</div>